package com.youlei.newgraduateproject.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.youlei.newgraduateproject.common.easyexcel.converter.ListStringConverter;
import com.youlei.newgraduateproject.common.easyexcel.converter.LocalDateStringConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author youlei
 * @since 2021-05-26
 */
@Data
@EqualsAndHashCode()
@ApiModel(value="SysOrders对象", description="")
public class SysOrders implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelIgnore
    @TableId(value = "order_id", type = IdType.AUTO)
    private Long orderId;

    @ExcelProperty("订单号")
    @ApiModelProperty(value = "订单号")
    private String orderNum;

    @ExcelProperty("订单创建者")
    @ApiModelProperty(value = "订单创建者的用户名")
    private String orderCreater;

    @ExcelProperty("订单审核人")
    @ApiModelProperty(value = "订单审核人的用户名")
    private String orderChecker;

    @ExcelProperty("订单确认者")
    @ApiModelProperty(value = "订单确认者的用户名")
    private String orderConfirmer;

    @ExcelProperty("订单结束者")
    @ApiModelProperty(value = "订单结束者的用户名")
    private String orderEnder;

    @ExcelProperty(value = "创建时间",converter = LocalDateStringConverter.class)
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime created;

    @ExcelProperty(value = "订单审核时间",converter = LocalDateStringConverter.class)
    @ApiModelProperty(value = "订单审核时间")
    private LocalDateTime orderCheckedtime;

    @ExcelProperty(value = "订单确认时间",converter = LocalDateStringConverter.class)
    @ApiModelProperty(value = "订单确认时间")
    private LocalDateTime orderConfirmtime;

    @ExcelProperty(value = "订单结束时间",converter = LocalDateStringConverter.class)
    @ApiModelProperty(value = "订单结束时间")
    private LocalDateTime orderEndtime;

    @ExcelIgnore
    @ApiModelProperty(value = "订单客户id")
    private Long orderCustomerid;

    @ExcelProperty("订单客户名")
    @ApiModelProperty(value = "订单客户名")
    @TableField(exist = false)
    private String orderCustomerName;

    @ExcelProperty("订单总金额")
    @ApiModelProperty(value = "订单总金额")
    private BigDecimal orderTotalmoney;

    @ExcelProperty("备注")
    @ApiModelProperty(value = "备注")
    private String remark;

    @ExcelIgnore
    private Integer deleted;

    @ExcelIgnore
    @ApiModelProperty(value = "订单项")
    @TableField(exist = false)
    private List<SysOrderitem> orderitems;

    @ExcelProperty(value = "订单项id",converter = ListStringConverter.class)
    @ApiModelProperty(value = "订单项id")
    @TableField(exist = false)
    private List<Long> orderitemsIds;

    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updated;

    @ExcelProperty("订单状态")
    private Integer statu;


}
